package {{ table.mark.package }};

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.ToString;

{%- for import in table.derived.java.imports %}
import {{ import }};
{%- endfor %}

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@TableName("{{ table.sql.name }}")
public class {{ table.common.label }} {
{%- for column_name, column in columns.items() %}
    {%- if column.sql.auto_increment %}
    @TableId(value = "{{ column.sql.name }}", type = IdType.AUTO)
    {%- endif %}
    private {{ column.derived.java.type }} {{ column.naming.field_name }}{% if column.derived.java.default_value %} = {{ column.derived.java.default_value }}{% endif %};
{%- endfor %}
}